asm
  ld sp,$FFFF
  end asm
 
#include "./library/smsrnd.bas"
#include "./library/pacmandelay.bas"
 
dim eee as uinteger at $E010
dim seed as uinteger at $E012
dim delay as uinteger at $E014
dim ee2 as uinteger at $E016
dim ee3 as uinteger at $E018
dim ee4 as uinteger at $E01A
dim eex as uinteger at $E01C
dim eey as uinteger at $E01E

sub funnybubbleputchar(txp1 as uinteger,typ1 as uinteger,tch1 as ubyte,tat1 as ubyte):
  poke $D000+(txp1*2)+(typ1*128),tch1
  poke $D001+(txp1*2)+(typ1*128),tat1
  end sub

seed=0

for eee=$C000 to $CFFF '-?
  seed=smsrnd(seed)
  poke eee,seed
  next



  for eee=$D000 to $DFFF step 2 '-?
    seed=smsrnd(seed)
    poke eee,seed
    next

  for eee=$D001 to $DFFF step 2 '-?
    seed=smsrnd(seed)
    poke eee,seed
    next

  for eee=$D001 to $DFFF step 2 '-?
    poke eee,0
    next

  for eee=$D000 to $DFFF step 2 '-?
    poke eee,0
    next



  for eee=$D000 to $DFFF step 2 '-?
    seed=smsrnd(seed):ee4=seed band $FF
    poke eee+0,($60+ee4)mod 256
    poke eee+1,(int(($60+ee4)/256))
    next




for ee2=0 to 15
  for ee3=0 to 15
    funnybubbleputchar(ee3+35,ee2+13,ee2*16+ee3,0)
    next:next

eex=25:eey=8
eee=0


do

funnybubbleputchar(13,3,48+(int(eee/100) mod 10),0)
funnybubbleputchar(14,3,48+(int(eee/10) mod 10),0)
funnybubbleputchar(15,3,48+(eee mod 10),0)


ee2=in(0) bxor 255
funnybubbleputchar(13,5,48+(int(ee2/100) mod 10),0)
funnybubbleputchar(14,5,48+(int(ee2/10) mod 10),0)
funnybubbleputchar(15,5,48+(ee2 mod 10),0)

ee2=in(1) bxor 255
funnybubbleputchar(13,6,48+(int(ee2/100) mod 10),0)
funnybubbleputchar(14,6,48+(int(ee2/10) mod 10),0)
funnybubbleputchar(15,6,48+(ee2 mod 10),0)

eey=eey-((ee2 band 1)/1)+((ee2 band 2)/2)
eex=eex-((ee2 band 4)/4)+((ee2 band 8)/8)

ee2=in(2) bxor 255
funnybubbleputchar(13,7,48+(int(ee2/100) mod 10),0)
funnybubbleputchar(14,7,48+(int(ee2/10) mod 10),0)
funnybubbleputchar(15,7,48+(ee2 mod 10),0)

ee2=in(3) bxor 255
funnybubbleputchar(13,8,48+(int(ee2/100) mod 10),0)
funnybubbleputchar(14,8,48+(int(ee2/10) mod 10),0)
funnybubbleputchar(15,8,48+(ee2 mod 10),0)


funnybubbleputchar(eex,eey,eee,0)

eee=eee+1
pacmandelay(1000)
loop

do



for ee2=0 to 255


for eee=$C000 to $CFFF '-?
  seed=smsrnd(seed)
  poke eee,seed
  next

  out 0,ee2
  for eee=$D000 to $DFFF '-?
    seed=smsrnd(seed)
    poke eee,seed
    next

  next

loop


'- static ADDRESS_MAP_START( funybubl_map, AS_PROGRAM, 8, funybubl_state )
'- AM_RANGE(0x0000, 0x7fff) AM_ROM
'- AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") // banked port 1?
'- AM_RANGE(0xc400, 0xcfff) AM_RAM_WRITE(funybubl_paldatawrite) AM_SHARE("paletteram") // palette
'- AM_RANGE(0xd000, 0xdfff) AM_RAMBANK("bank1") // banked port 0?
'- AM_RANGE(0xe000, 0xffff) AM_RAM

'- static ADDRESS_MAP_START( io_map, AS_IO, 8, funybubl_state )
'- ADDRESS_MAP_GLOBAL_MASK(0xff)
'- AM_RANGE(0x00, 0x00) AM_READ_PORT("SYSTEM") AM_WRITE(funybubl_vidram_bank_w)    // vidram bank
'- AM_RANGE(0x01, 0x01) AM_READ_PORT("P1") AM_WRITE(funybubl_cpurombank_w)     // rom bank?
'- AM_RANGE(0x02, 0x02) AM_READ_PORT("P2")
'- AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(funybubl_soundcommand_w)
'- AM_RANGE(0x06, 0x06) AM_READNOP     /* Nothing is done with the data read */
'- AM_RANGE(0x06, 0x06) AM_WRITENOP        /* Written directly after IO port 0 */
'- AM_RANGE(0x07, 0x07) AM_WRITENOP        /* Reset something on startup - Sound CPU ?? */




' 
' 
' sub oneplustwopalette(tid1 as uinteger,tvl1 as uinteger):
'   poke $C800+tid1,((tvl1 band $00E)*16 )  bor((tvl1 band $F00)/128) 
'   poke $C900+tid1,((tvl1 band $001)*128)  bor((tvl1 band $0F0)/8)   
'   'poke $C800+tid1,((tvl1 band $00E)*16 )                           bor((tvl1 band $F00)/128) bor((tvl1 band $800)/$800)
'   'poke $C900+tid1,((tvl1 band $001)*128) bor ((tvl1 band $00C)*8 ) bor((tvl1 band $0F0)/8)   bor((tvl1 band $080)/$080)
'   end sub
' 
' sub oneplustwoputchar(txp1 as uinteger,typ1 as uinteger,tch1 as ubyte,tat1 as ubyte)
'   poke $D000+(typ1*128)+(txp1*2),tch1
'   poke $D001+(typ1*128)+(txp1*2),tat1
'   end sub
' 
' seed=54321
' 
' 
' 
' for eee=$C800 to $C87F '-pal1
'   seed=smsrnd(seed)
'   poke eee,seed
'   next
' 
' for eee=$C900 to $C97F '-pal2
'   seed=smsrnd(seed)
'   poke eee,seed
'   next
' 
' 
' for ee2=0 to 31
'   for ee3=0 to 63
'     seed=smsrnd(seed)
'     oneplustwoputchar(ee3,ee2,(seed band 63)+128,seed band 128)
'     next:next
' 
' for ee2=0 to 15
'   for ee3=0 to 15
'     oneplustwoputchar(ee3+47,ee2+15,ee2*16+ee3,0)
'     next:next
' 
' eex=8:eey=8
' eee=0
' do
' 
' oneplustwoputchar(1,1,48+(int(eee/100) mod 10),0)
' oneplustwoputchar(2,1,48+(int(eee/10) mod 10),0)
' oneplustwoputchar(3,1,48+(eee mod 10),0)
' 
' ee2=in(0) bxor 255
' oneplustwoputchar(1,3,48+(int(ee2/100) mod 10),0)
' oneplustwoputchar(2,3,48+(int(ee2/10) mod 10),0)
' oneplustwoputchar(3,3,48+(ee2 mod 10),0)
' 
' ee2=in(1) bxor 255
' oneplustwoputchar(1,4,48+(int(ee2/100) mod 10),0)
' oneplustwoputchar(2,4,48+(int(ee2/10) mod 10),0)
' oneplustwoputchar(3,4,48+(ee2 mod 10),0)
' 
' ee2=in(2) bxor 255
' oneplustwoputchar(1,5,48+(int(ee2/100) mod 10),0)
' oneplustwoputchar(2,5,48+(int(ee2/10) mod 10),0)
' oneplustwoputchar(3,5,48+(ee2 mod 10),0)
' 
' eex=eex-((ee2 band 4)/4)+((ee2 band 8)/8)
' eey=eey-((ee2 band 1)/1)+((ee2 band 2)/2)
' 
' 
' 
' 
' ee2=in(3) bxor 255
' oneplustwoputchar(1,6,48+(int(ee2/100) mod 10),0)
' oneplustwoputchar(2,6,48+(int(ee2/10) mod 10),0)
' oneplustwoputchar(3,6,48+(ee2 mod 10),0)
' 
' ee2=in(4) bxor 255
' oneplustwoputchar(1,7,48+(int(ee2/100) mod 10),0)
' oneplustwoputchar(2,7,48+(int(ee2/10) mod 10),0)
' oneplustwoputchar(3,7,48+(ee2 mod 10),0)
' 
' 
' 
' 
' oneplustwoputchar(eex,eey,eee,0)
' 
' eee=eee+1
' loop
' 
' 
' do:loop
' 
' do
' 
' 'poke $C800,%11100000  '- bbbrrrrr
' 'poke $C900,%11111111  '- bbbggggg
' 
' oneplustwopalette(0,$F00)
' oneplustwopalette(1,$0F0)
' oneplustwopalette(2,$00F)
' oneplustwopalette(3,$C84)
' 
' for eee=$D000 to $DFFF step 2 'fgram
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' 
' 
' for eee=$C800 to $C87F '-pal1
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' 
' for eee=$C900 to $C97F '-pal2
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' 
' 
' 
' 
' loop
' 
' 
' 
' for eee=$C000 to $C7FF '?
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' 
' 
' 
' for eee=$C880 to $C8FF '?
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' 
' 
' for eee=$C980 to $C9FF '?
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' 
' for eee=$CA00 to $CFFF '?
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' 
' 
' 
' 
' 
' do:loop
' 
' do
' for eee=$C000 to $DFFF
'   seed=smsrnd(seed)
'   poke eee,seed
'   pacmandelay(1000)
'   next
' loop
' 
' do:loop
' 
' 
' 
' 
' '- AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION("maincpu", 0x10000)
' '- AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
' '- AM_RANGE(0xc800, 0xc87f) AM_RAM_WRITE(palette1_w) AM_SHARE("paletteram")
' '- AM_RANGE(0xc900, 0xc97f) AM_RAM_WRITE(palette2_w) AM_SHARE("paletteram2")
' '- AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(onetwo_fgram_w) AM_SHARE("fgram")
' '- AM_RANGE(0xe000, 0xffff) AM_RAM
' 
' 
' '
' 'sub putchar(txpos as uinteger,typos as uinteger,tch as uinteger, tadr as uinteger,txor as ubyte)
' '  dim trt as uinteger at $A000
' '  'for trt=0 to 7
' '  '  poke $A200+(txpos band 31)+(trt*32)+((typos mod 28)*256),peek(tadr+(tch*8)+trt) bxor txor
' '  '  next
' '  'minivadersldir32b($A200+(txpos band 31)+(trt*32)+((typos mod 28)*256), tadr+(tch*8),8)
' '  'minivadersfillramxor32b($A200+(txpos band 31)+(trt*32)+((typos mod 28)*256),txor,8)
' '
' '  minivadersldirxor32b($A200+(txpos band 31)+(trt*32)+((typos mod 28)*256), tadr+(tch*8),8,txor)
' '  end sub
' '
' 'sub writetext(txpos2 as uinteger,typos2 as uinteger,ttxt as uinteger, tleng as uinteger,tadr2 as uinteger, txor2 as uinteger)
' '  dim trt2 as uinteger at $A002
' '  for trt2=0 to tleng-1
' '    putchar(txpos2+trt2,typos2,peek(ttxt+trt2),tadr2,txor2)
' '    next
' '  end sub
' '
' 'for eey=0 to 27
' '  for eex=0 to 31
' '    seed=smsrnd(seed)
' '    putchar(eex,eey,96+(seed mod 9),@charmap01-253,$FF)
' '    next:next
' '
' 'for eey=0 to 7
' '  for eex=0 to 15
' '    putchar(eex+15,eey+11,eex+(eey*16),@charmap01-253,$FF)
' '    putchar(eex+15,eey+19,eex+(eey*16),@charmap01-253,$00)
' '    next:next
' '
' 'writetext(15,9,@text01,14,@charmap01-253,$FF)
' '
' 'exps=16
' 'eee=0
' '
' 'do
' '  ejst=peek($E008) bxor 255
' '  putchar(3,9,48+ (ejst mod 10)  ,@charmap01-253,$FF)
' '  putchar(2,9,48+ ( int(ejst/10) mod 10)  ,@charmap01-253,$FF)
' '  putchar(1,9,48+ ( int(ejst/100) mod 10)  ,@charmap01-253,$FF)
' '  eee=eee+1
' '  if (ejst band 1)<>0 then:exps=exps-1:end if
' '  if (ejst band 2)<>0 then:exps=exps+1:end if
' '  eqq=96+(eee mod 9)
' '  if (ejst band 4)<>0 then:eqq=96+4:end if
' '  putchar(exps,7,eqq,@charmap01-253,$FF)
' '  pacmandelay(2000)
' '  loop
' '
' '
' '
' 'seed=0
' '
' 'delay=100
' '
' ''for eey2=0 to 27
' ''  for eex=0 to 31
' ''    for eey=0 to 7
' ''      for eee=1 to delay:next
' ''      seed=smsrnd(seed)
' ''      poke $A200+eex+(eey*32)+(eey2*256),seed
' ''      next:next:next
' '
' '
' 'do
' '  seed=smsrnd(seed):eey2=seed mod 28
' '  seed=smsrnd(seed):eex=seed band 31
' '  for eey=0 to 7
' '    poke $A200+eex+(eey*32)+(eey2*256),$00
' '    next
' '  seed=smsrnd(seed):eey2=seed mod 28
' '  seed=smsrnd(seed):eex=seed band 31
' '  for eey=0 to 7
' '    poke $A200+eex+(eey*32)+(eey2*256),$FF
' '    next
' '  seed=smsrnd(seed):eey2=seed mod 28
' '  seed=smsrnd(seed):eex=seed band 31
' '  for eey=0 to 7
' '    seed=smsrnd(seed)
' '    poke $A200+eex+(eey*32)+(eey2*256),seed
' '    next
' '  loop
' '
' '
' 'delay=1000
' 'do
' '  for eee=$A200 to $BDFF
' '    seed=smsrnd(seed)
' '    poke eee,seed
' '    next
' '  for eee=1 to delay:next
' '  for eee=$A200 to $BDFF
' '    poke eee,0
' '    next
' '  for eee=1 to delay:next
' '  loop
' '
' '
' 'do
' '  loop
' '
' 'text01:
' 'asm
' '  defb "HELLO WORLD!!!!!"
' '  end asm
' '
' '
' '
' '
' '
' ''-------------------------------------------------------------------------------
' '
' '
' '
